module.exports = {
    // 这是一个主文件包括其他模块
    entry: {
      index:'./src/main.js'
    },
    // 编译的文件路径
    output: {
        //`dist`文件夹
        path: './dist',
        // 文件 `build.js` 即 dist/build.js
        publicPath: './dist/',
        filename: '/js/[name].min.js'
    },
    module: {
        // 一些特定的编译规则
        loaders: [{
                test: /\.vue$/,
                exclude: /node_modules/,
                loader: 'vue-loader'
            },
            { test: /\.css$/, 
              loader: 'style-loader!css-loader' 
            },
            { test: /\.less$/, loader: 'style-loader!css-loader!less-loader' },
            {
                test: /\.jsx?$/,
                exclude: /(node_modules|bower_components)/,
                loader: 'babel-loader', // 'babel-loader' is also a legal name to reference
                query: {
                    presets: ['es2015']
                }
            },
            {
                test:/\.(png)|(jpg)$/,
                loader: "url?limit=5000&name=images/[hash:8].[name].[ext]"
            }
        ]
    }
}
